package com.xiaomaoguai.cxf.demo1;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

/**
 * @Description :
 * @FileName: Client.java
 * @Author :WeiHui.Zhang
 * @Data : 2015年8月13日 上午10:56:29
 * @Version:V1.00
 */
public class Client {

	public static void main(String[] args) {
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
		factory.getInInterceptors().add(new LoggingInInterceptor());
		factory.getOutInterceptors().add(new LoggingOutInterceptor());
		factory.setServiceClass(HelloWorld.class);
		factory.setAddress("http://localhost:9000/helloWorld");
		HelloWorld client = (HelloWorld) factory.create();

		String reply = client.sayHi("ermao");
		System.out.println("Server said: " + reply);
		System.exit(0);
	}
}
